<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <?php
        $serveur="localhost";
        $user="root"; 
        $password="root"; 
        $bd = "carnet_adresses"; 

        $connexion_serveur = mysqli_connect($serveur, $user, $password, $bd); 
        
        if (mysqli_connect_errno()) { 
            echo ("Echec de la connexion : erreur n°". mysqli_connect_errno()." / ". 
            mysqli_connect_error()); 
        } 
        else { 
            echo "Connexion au serveur MySQL > OK !";
        }
  
        $sql = "SELECT * FROM entreprises";
    
        $req = mysqli_query($connexion_serveur, $sql); 
        ?>
        
        <form>
            <h2>LISTE DES ENTREPRISES</h2>
            <?php echo "<h3>Nombre d'entreprises affichées:   </h3>"; ?>  
        <?php
       while($resultats = mysqli_fetch_assoc($req)) {?>
        
            
            
            <table>
                <tr>
                    <td>n°</td>
                    <td><?php echo $resultats["id"]; ?></td>
                </tr>
                 <tr>
                    <td>Raison sociale</td>
                    <td><?php echo $resultats["raison_sociale"]; ?></td>
                </tr>
                <tr>
                    <td>Adresse</td>
                    <td><?php echo $resultats["adresse"]; ?></td>
                </tr>
               <tr>
                    <td>Téléphone</td>
                    <td><?php echo $resultats["telephone"]; ?></td>
                </tr>
                <tr>
                    <td>Fax</td>
                    <td><?php echo $resultats["fax"]; ?></td>
                </tr>
                      <tr>
                    <td>Email</td>
                    <td><?php echo $resultats["email"]; ?></td>
                </tr>
                <tr>
                    <td>Observations</td>
                    <td><?php echo $resultats["observations"]; ?></td>
                </tr><br><br>
            </table>
            
            
      <?php 
      
      } ?>
        
        
    </body>
</html>
